<?php

namespace common\models\message;

use Yii;

/**
 * This is the model class for table "message".
 *
 * @property integer $id
 * @property integer $status
 * @property string $title
 * @property string $email
 * @property string $content
 * @property string $create_time
 * @property string $replay_msg
 * @property string $name
 * @property integer $phone
 * @property string $ip
 */
class Message extends \yii\db\ActiveRecord
{
    public $verifyCode;
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'message';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['status', 'create_time', 'phone'], 'integer'],
            [['title', 'email', 'content', 'create_time', 'name', 'phone', 'user','verifyCode'], 'required'],
            [['title', 'email', 'content', 'replay_msg', 'name', 'ip', 'user', 'address'], 'string', 'max' => 255],
            ['verifyCode', 'captcha', 'message'=>'验证码错误','captchaAction'=>'/message/captcha'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'status' => Yii::t('app', '是否显示'),
            'title' => Yii::t('app', '留言标题'),
            'user' => Yii::t('app', '昵称'),
            'address' => Yii::t('app', '所在企业'),
            'email' => Yii::t('app', '邮箱'),
            'content' => Yii::t('app', '留言内容'),
            'create_time' => Yii::t('app', '添加时间'),
            'replay_msg' => Yii::t('app', '回复消息'),
            'name' => Yii::t('app', '姓名'),
            'phone' => Yii::t('app', 'Phone'),
            'ip' => Yii::t('app', 'Ip'),
        ];
    }
}
